/// @tags: Tarjan
#include <cstdio>
#include <iostream>
#include <stack>
#include <vector>

using std::cin, std::cout, std::endl;

namespace BlueQuantum {

constexpr int maxn = 1e5 + 1, maxm = 5e5 + 1;

int n, m;
int ecnt;
int heads[maxn];

struct Edge {
  int v, nxt;
} e[maxm * 2];

inline void add(int u, int v) { e[++ecnt].v = v, e[ecnt].nxt = heads[u], heads[u] = ecnt; }

int cnt, dfn[maxn], low[maxn], siz[maxn];
long long ans[maxn];
std::stack<int> stk;

void tarjan(int u) {
  dfn[u] = low[u] = ++cnt;
  siz[u] = 1;
  stk.push(u);
  int sum = 0;
  for (int i = heads[u], v; i; i = e[i].nxt) {
    if (!dfn[v = e[i].v]) {
      tarjan(v);
      siz[u] += siz[v];
      low[u] = std::min(low[u], low[v]);
      if (low[v] >= dfn[u]) {
        ans[u] += (long long)sum * siz[v];
        sum += siz[v];
      }
    } else
      low[u] = std::min(low[u], dfn[v]);
  }
  ans[u] += (long long)sum * (n - sum - 1);
  ans[u] += n - 1;
  ans[u] *= 2;
}

int main() {
  cin >> n >> m;
  for (int i = 1; i <= m; ++i) {
    int u, v;
    cin >> u >> v;
    add(u, v), add(v, u);
  }
  tarjan(1);
  for (int i = 1; i <= n; ++i) {
    cout << ans[i] << endl;
  }
  return 0;
}

}  // namespace BlueQuantum

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("/tmp/CodeTmp/testdata.in", "r", stdin);
  freopen("/tmp/CodeTmp/testdata.out", "w", stdout);
#else
  freopen("P3469 [POI2008]BLO-Blockade.in", "r", stdin);
  freopen("P3469 [POI2008]BLO-Blockade.out", "w", stdout);
#endif
#endif

  std::ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  return BlueQuantum::main();
}
